﻿using CIS.DB;
using System.Diagnostics;

namespace CIS.Web.Controllers
{
	public class BaseDbController : BaseController
	{
		protected CISEntities DbContext { get; set; }

		public BaseDbController()
		{
			DbContext = new CISEntities();
#if DEBUG
			DbContext.Database.Log = message => Debug.Write(message);
#endif
		}

		protected override void Dispose(bool disposing)
		{
			if (disposing)
			{
				DbContext.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}